home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Re Polygon shapes < prev    next >
Encoding:
Internet Message Format  |  1996-08-01  |  4.3 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Polygon shapes
  2. Sent:        7/24/96 8:58 AM
  3. Received:    7/24/96 9:21 AM
  4. From:        Owen J. Palmer, ojpalmer@fcom.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Brian, would it make since to upload this code to the ODF Tool page? I
  9. keep checking this page hoping to find some more useful contributions
  10. such as Arni's Sketch. (I haven't written anything I feel would be
  11. useful to contribute yet.)
  12.  
  13. Also, ODF team, I keep hoping to see the port of TGridView from MacApp
  14. that has been referenced several times on the ODF Tool page. I don't
  15. care if it is incomplete or buggy. I just want a starting point for
  16. porting our "spreadsheet data view" derived from the Calc example to
  17. ODF.
  18.  
  19. Thanks,
  20. Owen Palmer
  21.  
  22. Brian Arnold wrote:
  23. > Howdy ODF-ers,
  24. > Since my ODF Draw-derived part needed polygon shapes, I patched together a
  25. > polygon shape class and a hexagon shape subclass for testing.  I'm not
  26. > proud of it, but it works well enough for a demo.  Send me e-mail if you
  27. > want the sources (there isn't much source, mostly headers ;-).  Feel free
  28. > to provide feedback (before I go off defining more subclasses for my
  29. > part...).
  30. > Here are some notes I kept while writing it.  It took about a day to write,
  31. > graft into my Draw (er, Sketch) part, and test.
  32. > o) I would pummel the person who decided OpenDoc will use fixed point
  33. > numbers.  The reason is, you can't "just use them" with literals.  I took a
  34. > six-of-one approach, coercing FW_IntToFixed on my literals, then noted ODF
  35. > sometimes takes a half-a-dozen-of-the-other approach, converting FW_Fixeds
  36. > into ints, doing math with literals, then converting back to FW_Fixeds.
  37. > "Sheesh" is all I can say.
  38. > o) There is incomplete support for polygons in ODF 1; here's a key function
  39. > I identified as missing (included as a static fn in my PolyShp.cpp file):
  40. > //--------------------------------
  41. > //      FW_CreatePolygonODShape
  42. > //  !!! Missing from FWGrUtil.cpp
  43. > //--------------------------------
  44. > static ODShape* FW_CreatePolygonODShape(
  45. >         Environment *ev,
  46. >         unsigned long pointCount,
  47. >         const FW_SPoint* pointArray)
  48. > {
  49. >   ODShape* shape = ::FW_NewODShape(ev);
  50. >   ::FW_SetShapeRegion(ev, shape, ::FW_CreatePolygonRegion(pointCount,
  51. >                                         pointArray));
  52. >   return shape;
  53. > }
  54. > o) The private ODF representation for a Polygon effectively requires that
  55. > its points fCount be initialized once and not changed.  It would be more
  56. > convenient if SetPoints() could adjust the fCount and adjust the memory
  57. > pointed to by fPoints instead of throwing an assertion when SetPoints sets
  58. > more points than fCount.
  59. > o) Although the ODF Polygon shape renderer has an autoCloseFrame parameter,
  60. > when I drag my polygon shapes without a closed polygon (the OD polygon
  61. > shape I assume), they are are outlined screwy.  I had to make sure my
  62. > Hexagon shape subclass includes the first point as the last point even
  63. > though the parent class Polygon shape uses autoCloseFrame as true and draws
  64. > correctly without the last point.  Did I misunderstand this parameter's
  65. > purpose, or is there a defect/limitation in the OpenDoc polygon
  66. > representation?
  67. > o) I had initially copied the OvalShp sources as a template for developing
  68. > the PolyShp and HexShp sources, and I noticed these very simple shapes
  69. > files pull in a lot of headers that don't appear to be needed.  How much of
  70. > this is necessary?
  71. > o) There are ODF <blah-blah> shapes (derived from FW_TGrRefPtr), and ODF
  72. > <blah-blah>Shape shapes (derived from FW_CShape), the latter which look
  73. > similar to the ODF Draw shape types.  What is the relationship between all
  74. > of these?  Should ODF Draw (and hence my code as well) eventually be using
  75. > the FW_CShapes instead of defining its own parallel representations?
  76. > o) Finally, a thank-you to those who worked on shapes in ODF and ODF Draw:
  77. > I found them generally easier to work with and much more powerful than the
  78. > MacApp shape code in my existing app, despite the very minor issues listed
  79. > above.
  80. > - Brian
  81. > ---------------------------------------------------------------
  82. > Brian Arnold                                  arnold@lumina.com
  83. > Director of Software Development
  84. > Lumina Decision Systems, Inc.            http://www.lumina.com/
  85.